package health_system.health_system.websocket.Model;

public   class ChatMessage {
        private String type;                 // 消息类型
        private String fromUser;             // 发送者
        private String toUser;               // 接收者
        private String contentType;          // 内容类型
        private String content;              // 消息内容（文本或Base64编码的媒体）
        private String messageId;            // 消息唯一ID
        private Long timestamp;              // 时间戳
        private String relatedMessageId;     // 关联消息ID（回复、引用时使用）
        private Boolean read;                // 是否已读
        private Integer chunkIndex;          // 分块索引（大文件传输）
        private Integer totalChunks;         // 总分块数（大文件传输）
        private String fileName;             // 文件名（文件传输）
        private String fileExtension;        // 文件扩展名（文件传输）
        private Long fileSize;               // 文件大小（文件传输）
        private String fileId;               // 文件唯一ID（分块传输）
        private String originalType;         // 原始消息类型（分块传输）
        private Long totalSize;              // 总大小（分块传输）
        private String chunk;                // 分块内容（分块传输）

        // 判断消息是否与朋友圈相关
        public boolean isRelatedToSocialPost() {
            return MessageType.SOCIAL_POST.getValue().equals(type) ||
                   MessageType.SOCIAL_INTERACTION.getValue().equals(type);
        }

        // Getters and Setters
        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public String getFromUser() {
            return fromUser;
        }

        public void setFromUser(String fromUser) {
            this.fromUser = fromUser;
        }

        public String getToUser() {
            return toUser;
        }

        public void setToUser(String toUser) {
            this.toUser = toUser;
        }

        public String getContentType() {
            return contentType;
        }

        public void setContentType(String contentType) {
            this.contentType = contentType;
        }

        public String getContent() {
            return content;
        }

        public void setContent(String content) {
            this.content = content;
        }

        public String getMessageId() {
            return messageId;
        }

        public void setMessageId(String messageId) {
            this.messageId = messageId;
        }

        public Long getTimestamp() {
            return timestamp;
        }

        public void setTimestamp(Long timestamp) {
            this.timestamp = timestamp;
        }

        public String getRelatedMessageId() {
            return relatedMessageId;
        }

        public void setRelatedMessageId(String relatedMessageId) {
            this.relatedMessageId = relatedMessageId;
        }

        public Boolean isRead() {
            return read;
        }

        public void setRead(Boolean read) {
            this.read = read;
        }

        public Integer getChunkIndex() {
            return chunkIndex;
        }

        public void setChunkIndex(Integer chunkIndex) {
            this.chunkIndex = chunkIndex;
        }

        public Integer getTotalChunks() {
            return totalChunks;
        }

        public void setTotalChunks(Integer totalChunks) {
            this.totalChunks = totalChunks;
        }

        public String getFileName() {
            return fileName;
        }

        public void setFileName(String fileName) {
            this.fileName = fileName;
        }

        public String getFileExtension() {
            return fileExtension;
        }

        public void setFileExtension(String fileExtension) {
            this.fileExtension = fileExtension;
        }

        public Long getFileSize() {
            return fileSize;
        }

        public void setFileSize(Long fileSize) {
            this.fileSize = fileSize;
        }

        public String getFileId() {
            return fileId;
        }

        public void setFileId(String fileId) {
            this.fileId = fileId;
        }

        public String getOriginalType() {
            return originalType;
        }

        public void setOriginalType(String originalType) {
            this.originalType = originalType;
        }

        public Long getTotalSize() {
            return totalSize;
        }

        public void setTotalSize(Long totalSize) {
            this.totalSize = totalSize;
        }
        
        public String getChunk() {
            return chunk;
        }
        
        public void setChunk(String chunk) {
            this.chunk = chunk;
        }
    }
